#!/usr/bin/python
# -*- coding: UTF-8 -*-

import json
class Person:
    name = ""
    age = 0
    gender = ''
    def __init__(self, name='', age=0, gender = '男'):
        self.name = name
        self.age = age
        self.gender = gender

    def toString(self):
        return json.dumps(self.__dict__)
def main():

    p1  = Person('tuliang', 33)
    p2 = Person(name='tom')

    print(p1.toString())
    print(p2.toString())

if (__name__ == '__main__'):
    main()